<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.stu-info{
				width: 400px;
				height: 400px;
			}
		</style>
		<base href="<%=request.getContextPath()%>/">
				<script src="js/public/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
			<div class="stu-info">
			<table border="1px" cellspacing="0px" cellpadding="" width="100%" height="100%">
				<tr>
					<th colspan="4">学生信息一览</th>
					
				</tr>
				<tr>
					<td>姓名</td>
					<td id="sname"></td>
					<td colspan="2" rowspan="2" id="pic" align="center"></td>
				</tr>
				<tr>
					<td>性别</td>
					<td id="sex"></td>
				</tr>
				<tr>
					<td>班级</td>
					<td id="cid"></td>
					<td>联系电话</td>
					<td id="tel"></td>
				</tr>
				<tr>
					<td>房间</td>
					<td id="roomno"></td>
					<td>入住时间</td>
					<td id="livetime"></td>
				</tr>
			</table>
		</div>
	</body>
	<script type="text/javascript">
	$(function(){
		var sid=${param.id};
		//查询学生详细信息
	$.ajax({
		url:"stu/findStuInfo",
		data:{"id":sid},
		type:"post",
		success:function(data){
			$("#sname").html(data.sname);
			if(data.sex==1){
			$("#sex").html("男");
			}
			else if(data.sex==2){
				$("#sex").html("女");
			}
			$("#pic").html("<img src='../image/"+data.headimage+"' width='100px' height='100px'>")
			$("#cid").html(data.clazz.cname);
			$("#tel").html(data.tel);
			$("#roomno").html(data.room.address);
			$("#livetime").html(data.livetime);
		}
	});
})
	</script>
</html>
